package com.bluesky.example.fieldtest.util;

import java.lang.reflect.Field;

import com.bluesky.example.fieldtest.pojo.Bar;

public class Util {

	public static void readField(Class clazz){
		Field[] fields =clazz.getDeclaredFields();
		
		
		for(Field f : fields){
			System.out.println(f.getName());
			
		}
		
		//get super class
		Class superClass = clazz.getSuperclass();
		if(superClass!=Object.class)
			readField(superClass);
	}
	
	public static void main(String[] args) {
		readField(Bar.class);
		
	}
}
